package permissions

import (
	"context"
	"goAdminV1/api/permissions/v1"
	"goAdminV1/internal/model"
	"goAdminV1/utility"
)

func (c *ControllerV1) DepartmentCreate(ctx context.Context, req *v1.DepartmentCreateReq) (res *v1.DepartmentCreateRes, err error) {
	err = model.DepartmentsCreate(ctx, req)
	if err != nil {
		return nil, utility.Error(utility.CodeOperation, err)
	}
	return &v1.DepartmentCreateRes{
		Message: "部门创建成功",
	}, nil
}
